gusucode.com > 忠网网站广告管理系统 ZonGG V1.3 > 忠网网站广告管理系统 ZonGG V1.3\code\Uploadsave.asp

    <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>上传文件</title>
<style type="text/css">
<!--
.an {  font-family: "宋体"; font-size: 9pt; background-color: ; border: 1px solid; color: }
-->
</style>
</head>
<!-- #INCLUDE FILE="login.asp" -->
<!--#include file="Include/upload.inc" -->

<body leftmargin="0" topmargin="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td align="center">
<BR><BR>
<script language="Javascript">
function minipic(smileface)
{
window.opener.document.form.gif_url.value=smileface;
}
</script>
<%
set upload=new upload_hizi
set file=upload.file("file1")
formPath=UpFilePath&"/"

fileExt=lcase(right(file.filename,3))
if Instr(","&UpFileLeis&",",","&fileExt&",")=false then
%>
<script language="VBScript" type="text/VBScript">
 msgbox "系统不支持你上传的文件类型,请重新选择合适类型进行上传!"
 history.back(1)
              </script>
<%
response.end
end if
%>
<%
if file.filesize>UpFileSize*1024*1024*8 then
%>
<script language="VBScript" type="text/VBScript">
 msgbox "文件大小超出限制,请重新选择上传!"
 history.back(1)
</script>
<%
response.end 
end if
randomize
ranNum=int(90000*rnd)+10000
filename=formPath&PubCtime()&ranNum&"."&fileExt
if file.FileSize>0 then
file.SaveAs Server.mappath(FileName)

'' 存入数据库
Dim Picid
Picid=PicNewRuku(FileName)

end if


response.write "<hr color=#808080 width=300 size=1>一大小为 <font color=red>"&PubcSize(file.filesize/8)&"</font> 的 <font color=red>"&fileExt&"</font> 文件上传成功!<hr color=#808080 width=300 size=1><font class=red>广告图ID="&Picid&"</font>, 效果如下 >>> <a href='UploadDel.asp?f="&FileName&"&picid="&picid&"'>删除本文件,重新上传</a><hr color=#808080 width=300 size=1><BR>"
%>
<script language="Javascript">
minipic('<%=filename%>')
</script>
<%Select Case fileExt
         case "gif","jpg","bmp","ico","png"
              response.write "<img border=0 src='"&filename&"'>"
         case "swf"
              response.write "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0';'><param name=movie value='"&filename&"'><param name=quality value=high></object>"
         case else
              response.write "<a href='"&filename&"'>无法预览。</a>"
  End Select
%>

</td>
</tr>
</table>
</body>
</html>